class_name WinScreen
extends Control

const MESSAGE := "The %s\n is victorious!"

@onready var character_portrait: TextureRect = %CharacterPortrait
@onready var message: Label = %Message

@export var character: CharacterStats: set = _set_character

func _set_character(value: CharacterStats) -> void:
	character = value
	if not is_node_ready():
		await ready
	character_portrait.texture = character.portrait
	message.text = MESSAGE % character.character_name
	
func _on_main_menu_button_pressed() -> void:
	get_tree().change_scene_to_file(AutoLoader.MAIN_MENU_FILE)
